{% load forum_tags %}
{% load static %}

<div class="ui borderless menu" id="topicbar">

    <a class="item {% activate tab "latest" %} " href="{% url 'post_list' %}">
        <i class="list icon"></i> Latest
    </a>

    <a class="item {% activate tab "open" %} " href="{% url 'post_topic' 'open' %}">
        <i class="envelope open icon"></i> Open
    </a>

    <a class="item {% activate tab "jobs" %} " href="{% url 'post_topic' 'jobs' %}">
        <i class="briefcase icon"></i> Jobs
    </a>
    <a class="item {% activate tab "tutorials" %} " href="{% url 'post_topic' 'tutorials' %}">
        <i class="help circle icon"></i> Tutorials
    </a>
    <!--
    <a class="item {% activate tab "forum" %} " href="{% url 'post_topic' 'forum' %}">
        <i class="file icon"></i> Forum
    </a>
    -->

    <a class="item {% activate tab "tags" %} " href="{% url 'tags_list' %}">
        <i class="tag icon"></i> Tags
    </a>

    <a class="item  {% activate tab "about" %}" href="{% url 'pages' 'about' %}">
        <i class="info circle icon"></i>About
    </a>

    <a class="item  {% activate tab "faq" %}" href="/info/faq/">
        <i class="info recycle icon"></i>FAQ
    </a>

    {% if request.user.is_authenticated %}
        <a class="item {% activate tab "submit" %} " href="{% url 'herald_list' %}">
            <i class="newspaper icon"></i> Herald
        </a>
    {% endif %}

</div>

<div class="ui labeled icon top attached evenly divided menu" id="menu-header" user-id="{{ request.user.id }}">


    {% block headimg %}
        <div class="header item" id="logo">
            <a href="/"><img width="250px" src="{% static "images/logo6.svg" %}"></a>
        </div>
    {% endblock %}

    <a class="item {% activate tab "community" %}" href="{% url 'community_list' %}">
        <i class="world icon"></i> Community
    </a>

    <a class="item {% activate tab "planet" %} " href="{% url 'blog_list' %}">
        <i class="rss icon"></i> Planet
    </a>

    {% if request.user.profile.is_moderator %}
        <a class="item {% activate tab 'spam' %} " href="{% url 'post_topic' 'spam' %}">
            <i class="bug icon"></i> Spam {% count_badge counts.spam_count %}
        </a>
        <a class="item {% activate tab 'activity' %} " href="{% url 'view_logs' %}">
            <i class="chess queen icon"></i> Mods {% count_badge counts.mod_count %}
        </a>
    {% endif %}

    <a class="item {% activate tab "new" %}" href="{% url 'post_create' %}">
        <i class="edit icon"></i> New Post
    </a>

    <div class="right menu">

        {% if user.is_authenticated %}

            <a class="item  {% activate tab "profile" %}" href="{% url 'user_profile' user.profile.uid %}">
                <i class="{% user_icon_css user %}"></i> {{ user.profile.name }}
            </a>

            <a class="item  {% activate tab "logout" %}" href="{% url 'logout' %}" id="new-post">
                <i class="sign-out icon"></i> Log Out
            </a>
        {% else %}
            <a class="item  {% activate tab "login" %}" href="{% url 'login' %}" id="new-post">
                <i class="sign-in icon"></i> Log In
            </a>

        {% endif %}

    </div>
</div>
